<template>
	<view class="margin-xs radius bg-gray solids">
		<view class="padding-sm flex">
			<view class="basis-xl" @tap="clickOrderId(item._id)">订单编号:{{item._id}}<text class="margin-left-xs text-purple">复制</text></view>
			<view class="basis-xs text-right">{{$u.timeFrom(item.addTime)}}</view>
		</view>
		<view v-for="(goods,gIndex) in item.goodsArr" :key="gIndex" class="padding-sm flex bg-white">
			<image :src="goods.img" class="basis-xs radius" mode="widthFix" />
			<view class="basis-xl padding-left">
				<view>{{goods.name}}</view>
				<view class="text-red padding-top-sm padding-bottom-sm">¥{{(goods.price/100).toFixed(2)}}</view>
				<view class="text-grey">{{item.status===0?'未支付':'已支付'}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			item:{
				type:Object,
				default:{}
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			clickOrderId(orderId){
				uni.setClipboardData({
				    data: orderId,
				    success: function () {
				        uni.showToast({
				        	title: '已经复制订单编号信息到剪切板',  
				        	mask: false,  
				        	duration: 1500,  
				        	icon:"none"  
				        });
				    }
				});
			},
		}
	}
</script>

<style lang="scss">

</style>
